package io.renren.modules.app.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.modules.app.entity.ImGroupEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.modules.app.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 *
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-05-19 09:14:52
 */
@Mapper
public interface ImGroupDao extends BaseMapper<ImGroupEntity> {

    @Select("SELECT g.* FROM im_group_user gu ,im_group g WHERE gu.group_id=g.id and gu.user_id = #{user.userId}")
    List<ImGroupEntity> getList(@Param("user") UserEntity user);
}
